package com.naizhuai.network.apistore;

import android.support.annotation.CheckResult;

import com.naizhuai.Model.db.user.PersonUserBean;
import com.naizhuai.network.Config;
import com.naizhuai.network.entity.ResultResponse;
import com.naizhuai.ui.entity.ImgBean;
import com.naizhuai.ui.entity.User.AppMessage;
import com.naizhuai.ui.entity.User.AppMessageList;
import com.naizhuai.ui.entity.User.CateGoryMsg;
import com.naizhuai.ui.entity.User.Simulation;
import com.naizhuai.ui.entity.User.SimulationData;
import com.naizhuai.ui.entity.User.UserRank;
import com.naizhuai.ui.entity.UserUpdate;
import com.naizhuai.ui.entity.setting.ThankDetailsData;
import com.naizhuai.ui.user.UserLogin;

import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Query;
import rx.Observable;

/**
 * @author：lichenxi
 * @date 2018/2/24 16
 * email：525603977@qq.com
 * Fighting
 */
public interface UserDataApiRequest {

    @FormUrlEncoded
    @POST(Config.SEND_SMS)
    @CheckResult
    Observable<ResultResponse<String>> sendSms(@Field("phone") String phonenumber,
                                                  @Field("type") String type);

    @FormUrlEncoded
    @POST(Config.USER_REGISTER)
    @CheckResult
    Observable<ResultResponse<UserLogin>> userRegister(@Field("truename") String username,
                                                    @Field("phone") String phone,@Field("code") String code,
                                                    @Field("password") String password, @Field("email") String email);

    @FormUrlEncoded
    @POST(Config.USER_LOGIN)
    @CheckResult
    Observable<ResultResponse<UserLogin>> userlogin(@Field("phone") String phonenumber,
                                                 @Field("password") String type);
    @GET(Config.USER_INFO)
    @CheckResult
    Observable<ResultResponse<PersonUserBean>> getUserInfo();

    @GET(Config.USER_INFO)
    @CheckResult
    Observable<ResultResponse<PersonUserBean>> searchUserInfo(@Query("searchUid") String searchId);


    @Multipart
    @POST(Config.USER_UPLOAD_IMG)
    @CheckResult
    Observable<ResultResponse<ImgBean>> uploadFileWithPartMap(
            @PartMap()Map<String, String> parammap,
            @Part MultipartBody.Part file);

    @Multipart
    @POST(Config.Mult_IMG)
    @CheckResult
    Observable<ResultResponse<List<ImgBean>>> uploadFileWithPartMaps(
            @PartMap()Map<String, String> parammap,
            @Part List<MultipartBody.Part> files);


    @FormUrlEncoded
    @POST(Config.UPDATE_PROFILE)
    @CheckResult
    Observable<ResultResponse<UserUpdate>> userupdate(@FieldMap Map<String,String> personmap);

    @FormUrlEncoded
    @POST(Config.RESET_PASSWORD)
    @CheckResult
    Observable<ResultResponse<String>> resetPassword(@FieldMap Map<String,String> personmap);

    @GET(Config.PERSONAL_RANKING)
    @CheckResult
    Observable<ResultResponse<UserRank>> getPerson_Rank(@Query("key") String key,@Query("dateValue") String dateValue);

    @GET(Config.THANK_CARD_CONTENT)
    @CheckResult
    Observable<ResultResponse<List<ThankDetailsData>>> getThankCard();

    @GET(Config.GROUP_RANKING)
    @CheckResult
    Observable<ResultResponse<UserRank>> getGroup_Rank(@Query("key") String key,@Query("dateValue")String dateValue);

    @GET(Config.COMPANY_EFFECT_POINT_PAGE)
    @CheckResult
    Observable<ResultResponse<SimulationData>> getComPanySimalationData();

    @POST(Config.COMPANY_EFFECT_POINT)
    @FormUrlEncoded
    @CheckResult
    Observable<ResultResponse<String>> setComPanySimalationData(@Field("effectData") String effectData);


    @GET(Config.GET_APP_MESSAGE)
    @CheckResult
    Observable<ResultResponse<List<AppMessage>>> getAppMessage();

    @GET(Config.GET_APP_MESSAGE_LIST)
    @CheckResult
    Observable<ResultResponse<CateGoryMsg>> getAppMessageList(@Query("categoryId") String categoryId);

}
